import tornado.ioloop  
import tornado.web  
import httpx  
  
import hashlib
# 定义用户名和密码  
username = "18032381282"  
password = "a1234567"  
  
# 对密码进行MD5加密  
password_md5 = hashlib.md5(password.encode('utf-8')).hexdigest()  
  
# 定义POST请求的URL和数据  
url = 'http://app.wlwapp.cn/api/v2/login'  # 替换为你的API URL  
data = {  
    "username": username,  
    "password": password_md5  
}  
import httpx
async def send_post_request():  
    # 发送异步POST请求  
    async with httpx.AsyncClient() as client:  
        response = await client.post(url, json=data)  # 注意：这里直接使用json参数，httpx会处理编码和设置Content-Type  
    return response.text
def send_post_request(): 
    return {"55":"ttt"}
class MainHandler(tornado.web.RequestHandler):  
    async def get(self):  
        res=send_post_request()# 发送异步POST请求  
        # 将响应内容返回给客户端  
        self.write(res)

def make_app():  
    return tornado.web.Application([  
        (r"/", MainHandler),  
    ])  
  
if __name__ == "__main__":  
    app = make_app()  
    app.listen(8888)  
    tornado.ioloop.IOLoop.current().start()